package com.mxpio.erp.common.oa.entity;

import com.mxpioframework.filestorage.entity.MxpioFileInfo;
import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.jpa.policy.impl.UUIDPolicy;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_OA_REIMBURSEMENT_LINE")
@Schema(description="报销单-明细-项目-普通")
public class OaReimbursementLine extends BaseEntity {

    @Id
    @Generator(policy = UUIDPolicy.class)
    @Column(name = "ID_")
    @Schema(description = "主键")
    private String id;

    @Column(name = "BIZ_NO_")
    @Schema(description = "报销单编号")
    private String bizNo;

    @Column(name = "FILE_NO_",columnDefinition = "TEXT")
    @Schema(description = "附件")
    @Dict(dicCode = "fileNo", dicEntity = MxpioFileInfo.class, dicText = "fileName")
    private String fileNo;

    @Column(name = "INVOICE_NO_")
    @Schema(description = "发票号")
    private String invoiceNo;

    @Column(name = "INVOICE_TYPE_")
    @Dict(dicCode = "ERP_SALES_INVOICE_KIND")
    @Schema(description = "发票类型")
    private String invoiceType;

    @Column(name = "UNTAX_AMOUNT_")
    @Schema(description = "无税金额")
    private BigDecimal untaxAmount;

    @Column(name = "TOTAL_AMOUNT_")
    @Schema(description = "含税金额")//价税合计
    private BigDecimal totalAmount;

    @Column(name = "TAX_RATE_")
    @Schema(description = "税率")
    private BigDecimal taxRate ;

    @Column(name = "PRO_MONEY_")
    @Schema(description = "金额")
    private BigDecimal proMoney;

    @Column(name = "TAX_")
    @Schema(description = "税额")
    private BigDecimal tax;

    @Column(name = "MEMO_")
    @Schema(description = "备注")
    private String memo;





//
//    @Transient
//    private BigDecimal checkMoney;//已勾稽数量
//    @Transient
//    private BigDecimal uncheckMoney;;//未勾稽数量
//    @Transient
//    private OaReimbursement oaReimbursement;

}
